/**
 * 库存变动 api
 */
import request from '@/utils/request'

const BASE_URL = '/wms/store-change'

/**
 * 获取库存变动分页列表
 * @param { pageRequest } query
 * @returns
 */
export function getPageList(query) {
  return request({
    url: BASE_URL + '/page-list',
    method: 'POST',
    data: query
  })
}

/**
 * 获取在场库存明细
 */
export function getInStoreList(query) {
  return request({
    url: BASE_URL + '/in-store-list',
    method: 'POST',
    data: query
  })
}

/**
 * 锁定库存变动
 */
export function lockStoreChange(id) {
  return request({
    url: BASE_URL + '/lock/' + id,
    method: 'POST'
  })
}

/**
 * 批量锁定库存变动
 */
export function batchLock(ids) {
  return request({
    url: BASE_URL + '/batch-lock',
    method: 'POST',
    data: ids
  })
}

/**
 * 解锁库存变动
 */
export function unlockStoreChange(id) {
  return request({
    url: BASE_URL + '/unlock/' + id,
    method: 'POST'
  })
}

/**
 * 批量解锁定库存变动
 */
export function batchUnlock(ids) {
  return request({
    url: BASE_URL + '/batch-unlock',
    method: 'POST',
    data: ids
  })
}

/**
 * 库存移位申请
 */
export function storeMove(data) {
  return request({
    url: BASE_URL + '/move/apply',
    method: 'POST',
    data
  })
}
// 报废申请
export function scrapApply(changeIdList) {
  return request({
    url: BASE_URL + '/scrap/apply/'+changeIdList,
    method: 'POST',
    
  })
}
